package com.sdgakj.utils.wechat.common.exception;

public class ServiceException extends AbstractRuntimeException
{
  private static final long serialVersionUID = -9175626800187309784L;
  private final int code;
  private final String message;

  public ServiceException(IServiceExceptionEnum _enum)
  {
    this.code = _enum.getCode();
    this.message = _enum.getMessage();
  }

  public ServiceException(IServiceExceptionEnum _enum, Throwable cause) {
    super(cause);
    this.code = _enum.getCode();
    this.message = _enum.getMessage();
  }

  public int getCode()
  {
    return this.code;
  }
  public String getMessage() {
    return this.message;
  }
}